package com.zhangbaiyan.zhuse;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author zhangbaiyan
 * @date 2024-09-24 20:40
 * @description:
 * @version:
 */
public class Foodie extends Thread {
    ArrayBlockingQueue<String> queue;

    public Foodie(ArrayBlockingQueue<String> queue) {
        this.queue = queue;
    }

    @Override
    public void run() {
        while (true){
            try {
                //从队列中取出一个面条
                String food = queue.take();
                System.out.println("吃了碗food了");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
